package com.websocket.rockwebsocket.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

@Configuration
public class WebSocketConfig {

  /**
   * ServerEndpointExporter 作用
   *
   * 这个bean会自动注册使用@ServerEndpointExporter注解声明的websocket endpoint
   *
   * @return
   */
  @Bean
  public ServerEndpointExporter serverEndpointExporter(){
    return new ServerEndpointExporter();
  }

}
